package org.base.sys.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.base.common.annotation.JsonEnum;
import org.base.sys.enums.BizType;
import org.base.sys.enums.OpStatus;
import org.base.sys.enums.OpType;

import java.time.LocalDateTime;

/**
 * <p>
 * 操作日志记录
 * </p>
 *
 * @author AutoGenerator
 * @since 2020-07-29
 */
@Data
@TableName("t_sys_op_log")
@ApiModel(value = "SysOpLog对象", description = "操作日志记录")
public class SysOpLog {

    private static final long serialVersionUID = 1L;

    private Long id;

    @ApiModelProperty(value = "模块标题")
    private String title;

    @ApiModelProperty(value = "业务类型（0其它 1新增 2修改 3删除）")
    @JsonEnum(BizType.class)
    private Integer businessType;

    @ApiModelProperty(value = "方法名称")
    private String method;

    @ApiModelProperty(value = "请求方式")
    private String requestMethod;

    @ApiModelProperty(value = "操作类别（0其它 1后台用户 2手机端用户）")
    @JsonEnum(OpType.class)
    private Integer opType;

    @ApiModelProperty(value = "操作人员")
    private String opName;

    @ApiModelProperty(value = "请求URL")
    private String opUrl;

    @ApiModelProperty(value = "主机地址")
    private String opIp;

    @ApiModelProperty(value = "请求参数")
    private String opParam;

    @ApiModelProperty(value = "返回参数")
    private String jsonResult;

    @ApiModelProperty(value = "操作状态（0正常 1异常）")
    @JsonEnum(OpStatus.class)
    private Integer status;

    @ApiModelProperty(value = "错误消息")
    private String errorMsg;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.DEFAULT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "登录地点")
    private String opLocation;


}
